/* eslint-disable */
// 该文件由 OneAPI 自动生成，请勿手动修改！
import {apiPrefixDispose} from '@/utils/format';
import {request} from '@umijs/max';





// 查询密码列表
export async function pagePasswordApi<T = any>(body: KeePassPage) {
    return request<API.ResultPageVO<KeePassVO>>(apiPrefixDispose('/password/page'), {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      data: body,
    });
  }



// 新增密码
export async function createPasswordApi<T = any>(body: CreateKeePass) {
    return request<API.ResultVO<string>>(apiPrefixDispose('/password/create'), {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      data: body,
    });
  }



// 查看密码
export async function viewPasswordApi<T = any>(
    id:number|string
    , secret:string
    , options?: { [key: string]: any },
  ) {
    return request<API.ResultVO<string>>(apiPrefixDispose(`/password/view/${id}`), {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      data: {secret:secret},
      ...(options || {}),
    });
  }


// 删除密码
export async function deletePasswordApi<T = any>(
    id:number
    , options?: { [key: string]: any },
  ) {
    return request<API.ResultVO<string>>(apiPrefixDispose(`/password/delete/${id}`), {
      method: 'DELETE',
      ...(options || {}),
    });
  }


// 获取rsa公私钥 (用于 rsa方式 加密和解密，用户保存私钥用于解密。公钥进行加密。记得保存哦)
export async function rsaKeyApi<T = any>(
    options?: { [key: string]: any },
  ) {
    return request<API.ResultVO<RSAKey>>(apiPrefixDispose(`/password/rsa/key`), {
      method: 'GET',
      ...(options || {}),
    });
  }

  